package org.jsola.hr.web;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.jsola.core.Page;
import org.jsola.core.Result;
import org.jsola.hr.dto.EmpSocInfoAddBatchDTO;
import org.jsola.hr.dto.SocProgItemUpdateDTO;
import org.jsola.hr.query.*;
import org.jsola.hr.vo.*;
import org.jsola.hr.vo.excel.FieldItemGroupVO;
import org.springframework.core.io.Resource;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import javax.validation.Valid;
import java.util.List;
import java.util.Map;

/**
 * @author lyh
 */
@Api(tags = "hr-员工社保状态转换")
public interface IEmpSocTransformControllerAPI {

    /**
     * 补收
     *
     * @param fillSocQuery 查询参数
     * @return 确认标识
     */
    @ApiOperation(value = "补收")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "fillSocQuery", dataType = "FillSocQuery", value = "查询参数", paramType = "body")
    })
    Result<Integer> fillGather(FillSocQuery fillSocQuery);

    /**
     * 补差
     *
     * @param fillSocQuery 查询参数
     * @return 确认标识
     */
    @ApiOperation(value = "补差")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "fillSocQuery", dataType = "FillSocQuery", value = "查询参数", paramType = "body")
    })
    Result<String> fillDifference(FillSocQuery fillSocQuery);

    /**
     * 补缴
     *
     * @param fillSocQuery 查询参数
     * @return 确认标识
     */
    @ApiOperation(value = "补缴")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "fillSocQuery", dataType = "FillSocQuery", value = "查询参数", paramType = "body")
    })
    Result<Integer> pfFillPayment(FillSocQuery fillSocQuery);

    /**
     * 查询某参保方案的使用人数
     *
     * @param socProgId 参保方案Id
     * @param companyId 公司Id
     * @return 人数
     */
    @ApiOperation(value = "查询某参保方案的使用人数")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "socProgId", dataType = "String", value = "参保方案Id", paramType = "query"),
            @ApiImplicitParam(name = "companyId", dataType = "String", value = "公司Id", paramType = "query")
    })
    Result<SocProgCountAndNextMonthVO> selectEmpCountWithSocProgId(String socProgId, String companyId);


    /**
     * 补收补缴预览
     *
     * @param previewFillQuery 预览参数
     * @return 预览对象
     */
    @ApiOperation(value = "补收补缴预览")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "previewFillQuery", dataType = "PreviewFillQuery", value = "预览参数", paramType = "body")
    })
    Result<List<SocFillPreviewVO>> previewFill(PreviewFillQuery previewFillQuery);

    /**
     * 社保名单查询所有表头
     *
     * @param companyId 公司Id
     * @param monthId   参保月份Id
     * @return 确认标识
     */
    @ApiOperation(value = "社保名单查询所有表头")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "companyId", dataType = "String", value = "公司Id", paramType = "path"),
            @ApiImplicitParam(name = "monthId", dataType = "String", value = "参保月Id", paramType = "path")
    })
    Result<List<FieldItemGroupVO>> selectAllHead(String companyId, String monthId);

    /**
     * 社保名单导出
     *
     * @param empSocTransformQuery 导出参数
     * @return excel
     */
    @ApiOperation(value = "社保名单导出")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "empSocTransformQuery", dataType = "EmpSocTransformQuery", value = "导出参数", paramType = "body")
    })
    ResponseEntity<Resource> export(EmpSocTransformQuery empSocTransformQuery);

    /**
     * 参保管理导出
     *
     * @param empSocInfoQuery 导出参数
     * @return excel
     */
    @ApiOperation(value = "参保管理导出")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "empSocInfoQuery", dataType = "EmpSocInfoQuery", value = "导出参数", paramType = "body")
    })
    ResponseEntity<Resource> exportEmpSocInfo(EmpSocInfoQuery empSocInfoQuery);

    /**
     * 社保个人详情导出
     *
     * @param companyId        公司Id
     * @param empId            员工Id
     * @param empSocInfoIdList 参保信息Id列表
     * @return excel
     */
    @ApiOperation(value = "社保个人详情导出")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "companyId", dataType = "String", value = "公司Id", paramType = "query"),
            @ApiImplicitParam(name = "empId", dataType = "String", value = "员工Id", paramType = "query"),
            @ApiImplicitParam(name = "empSocInfoIdList", dataType = "List<String>", value = "参保信息Id列表", paramType = "query")

    })
    ResponseEntity<Resource> empSocDetailsExport(String companyId, String empId, List<String> empSocInfoIdList);

    /**
     * 社保名单详情显示
     *
     * @param empSocTransformQuery 查询参数
     * @return 确认标识
     */
    @ApiOperation(value = "社保名单详情显示")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "empSocTransformQuery", dataType = "EmpSocTransformQuery", value = "查询参数", paramType = "body")
    })
    Result<Page<EmpSocTransformVO>> selectEmpSocInfoByEmpId(EmpSocTransformQuery empSocTransformQuery);

    /**
     * 社保名单列表显示
     *
     * @param empSocTransformQuery 查询参数
     * @return 社保名单
     */
    @ApiOperation(value = "社保名单列表显示")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "empSocTransformQuery", dataType = "EmpSocTransformQuery", value = "查询参数", paramType = "body")
    })
    Result<Page<EmpSocTransformVO>> selectEmpSocList(EmpSocTransformQuery empSocTransformQuery);

    /**
     * 查询某个月参保管理顶部数量统计
     *
     * @param empSocInfoQuery 查询参数
     * @return 数量统计
     */
    @ApiOperation(value = "查询某个月参保管理顶部数量统计")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "empSocInfoQuery", dataType = "EmpSocInfoQuery", value = "查询参数", paramType = "query")
    })
    Result<EmpSocTransformCountVO> selectEmpSocCount(EmpSocInfoQuery empSocInfoQuery);

    /**
     * 查询社保名单顶部数量统计
     *
     * @param companyId 公司Id
     * @return 数量统计
     */
    @ApiOperation(value = "查询社保名单顶部数量统计")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "companyId", dataType = "String", value = "公司Id", paramType = "query")
    })
    Result<EmpSocTransformCountVO> selectEmpSocListCount(String companyId);

    /**
     * 获取所有尾数处理类型
     *
     * @return 所有尾数处理类型
     */
    @ApiOperation(value = "获取所有尾数处理类型")
    @ApiImplicitParams({})
    Result<Map<String, Integer>> selectIncreaseOrDecreaseListCount();


    /**
     * 获取所有社保名单查询参数枚举
     *
     * @param companyId 公司Id
     * @return 枚举显示
     */
    @ApiOperation(value = "获取所有社保名单查询参数枚举")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "companyId", dataType = "String", value = "公司Id", paramType = "body")
    })
    Result<EmpSocListQueryEnumVO> getEmpSocListQueryEnum(String companyId);


    /**
     * 社保名单详情顶部金额统计
     *
     * @param companyId 公司Id
     * @param empId     员工Id
     * @return 统计信息
     */
    @ApiOperation(value = "社保名单详情顶部金额统计")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "companyId", dataType = "String", value = "公司Id", paramType = "body"),
            @ApiImplicitParam(name = "empId", dataType = "String", value = "员工Id", paramType = "body")
    })
    Result<EmpSocTransformCountVO> selectEmpSocInfoByEmpIdCount(String companyId, String empId);

    /**
     * 查询社保名单详情左侧信息
     *
     * @param empId 员工Id
     * @return 详情信息
     */
    @ApiOperation(value = "查询社保名单详情左侧信息")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "empId", dataType = "String", value = "员工Id", paramType = "query")
    })
    Result<EmpSocBrieflyVO> selectEmpSocBriefly(@Valid @RequestParam("empId") String empId);
}
